<?php

class Adept_Component_MessageList extends Adept_Component_Base {

    protected $group = null;

    public function getMessages() 
    {
        $form = $this->findParentByClass('Adept_Component_Form');
        $groupId = !is_null($this->group) ? $this->group : (!is_null($form) ? $form->getId() : '');
        $messages = Adept_MessageSet::getInstance()->getMessages($groupId);
        return $messages;
    }

    public function getGroup() {
        return $this->group;
    }

    public function setGroup($group) {
        $this->group = $group;
    }

    public function hasRenderer()	{
        return true;
    }

}
